home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 297_02 / verif.spr < prev    next >
Text File  |  1980-01-01  |  1KB  |  62 lines

  1. /* verif.pro */
  2. /* load this as well as your programme. Then call (verif). */
  3. /* This wil show up goals on which you may have forgotten arguments
  4.    for example. If you get just a yes then it has not found anything 
  5.    wrong.
  6. */
  7.  
  8. ((verif)
  9.  /* You might want to comment out this message when you are
  10.    familiar with it :
  11.  */
  12.  (writes "A goal is unsatifiable ")
  13.  (writes "if it can never succeed. ")
  14.  (nl)
  15.  (pause_cafe)
  16.  (programme_goal G Clause_body)/* bactrack to here */
  17.  (unsatisfiable G)
  18.  (warning_unsatisfiable G Clause_body)
  19.  (fail)
  20. )
  21. (verif)
  22.  
  23. ((programme_goal G (Head|Goals))
  24.  (clause Head Goals)
  25.  (member G Goals)
  26. )
  27.  
  28. ((unsatisfiable G)
  29.  (var G)
  30.  (cut)
  31.  (fail)
  32. )
  33. ((unsatisfiable G)
  34.  (clause G _) /* it's unifiable with the head of a rule */
  35.  (cut)
  36.  (fail)/* therefore it's not unsatisfiable */
  37. )
  38. ((unsatisfiable (Functor | Args))
  39.  (atom Functor)
  40.  (builtin Functor)
  41.  (cut)
  42.  (fail)
  43. )
  44. (unsatisfiable _)
  45.  
  46. ((warning_unsatisfiable G Body)
  47.  (put 7) /* beep */
  48.  (writes "The goal ")
  49.  (display G)
  50.  (writes "in the clause")(nl)
  51.  (display Body)(nl)
  52.  (writes "is unsatisfiable. ")(nl)
  53.  (pause_cafe)
  54. )
  55.  
  56. ((pause_cafe)
  57.  (writes "Type Return or Enter")
  58.  (get _)
  59. )
  60.  
  61. /* end of file */
  62.